 

const useAppStore = defineStore("app", {
  persist: true,
  state: () => ({
    sidebar: {
      opened: true,
      withoutAnimation: false,
      hide: false,
    },
    devive: "desktop",
    size: localStorage.getItem("size") || "small",
    isRouterAlive: true,
  }),

  actions: {
    toggleSideBar(withoutAnimation) {
      if (this.sidebar.hide) {
        return false;
      }

      this.sidebar.opened = !this.sidebar.opened;
      this.sidebar.withoutAnimation = withoutAnimation;
    },
    closeSideBar(withoutAnimation) {
      this.sidebar.opened = false;
      this.sidebar.withoutAnimation = withoutAnimation;
    },
    setSize(size) {
      this.size = size;
    //   localStorage.setItem("size", size);
    },
    toggleSideBarHide(status) {
      this.sidebar.hide = status
    },
  },
});
export default useAppStore;
